package com.neusoft.demo3;

public class Rectangle {
    private int width;
    private int height;

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getArea() {
        return getWidth() * getHeight();
    }

    public int getPer() {
        return (getWidth() + getHeight())* 2;
    }

    public void showAll() {
        System.out.println(getWidth() + "---" + getHeight() + "---" + getArea() + "---" + getPer());
    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.setWidth(10);
        rectangle.setHeight(20);
        rectangle.showAll();
    }
}
